package com.yinwq.shorturl.controller;

import com.yinwq.shorturl.service.ReplaceSqlParamsService;
import com.yinwq.shorturl.utils.Result;
import com.yinwq.shorturl.utils.ResultUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: yinwenqiang@qccr.com
 * @Date: Created in 2019/8/18 11:54 AM
 */

@RestController
public class ReplaceSqlParamsController {

    @Resource
    private ReplaceSqlParamsService replaceSqlParamsService;

    @RequestMapping("/replace")
    public Result replace(String sql, String sqlParamsStr){
        String result = replaceSqlParamsService.replaceSqlParams(sql, sqlParamsStr);
        return ResultUtil.success(result);
    }



}
